package com.trex.lwlsh.dataDeal;

import com.trex.lwlsh.model.ModuleModel;
import com.trex.lwlsh.util.ReadExeclUtil;

import java.util.ArrayList;

/**
 * Create by Trex on 2018/1/13
 * 封装Case
 */
public class LoadCase {

    /**
     * main 测试类
     * @param args
     */
    public static void main(String[] args) {

    }



    /**
     * 把所有的case装起来
     * @param Template
     * @return
     * @throws Exception
     */
    public ArrayList<ModuleModel> LoadCase(String [] Template) throws Exception {

        ArrayList<ModuleModel> ModuleList =new    ArrayList<ModuleModel>();
        for(int i=0;i<Template.length;i++){
            try{
                ModuleModel module=new  ModuleModel();
                ReadExeclUtil LoadData=new  ReadExeclUtil();
                module.setName(Template[i]);
                module.setFileName(Template[i]);
                module.setCaseList(LoadData.read(Template[i]));
                ModuleList.add(module);

            }catch(Exception e){
                e.printStackTrace();
            }
        }
        return ModuleList;
    }
}
